package com.sakura.thread.chapter1;

/**
 * Created by apple on 2018/12/10.
 */
public class JoinPractice1 {
    public static void main(String[] args) throws InterruptedException {
        Thread threadOne = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                System.out.println("threadone over!");
            }
        });

        Thread threadTwo = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                System.out.println("threadTwo over!");
            }
        });

        threadOne.start();
        threadTwo.start();

        System.out.println("wait");

        threadOne.join();
        threadTwo.join();


    }
}
